package cn.csc.module.product.api.spu.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Digits;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.LocalDateTime;

@Data
public class SpuDTO {

    private BigInteger id;
    @ApiModelProperty(value = "品牌ID")
    private BigInteger brandId;

    @ApiModelProperty(value = "分类ID", required = true)
    @NotNull(message = "分类ID不能为空")
    private BigInteger categoryId;

    @NotNull(message = "类目名称不能为空")
    @NotBlank(message = "类目名称不能为空")
    @ApiModelProperty(value = "类目名称组合", required = true)
    private String categoryName;

    @NotNull(message = "分类ID不能为空")
    @ApiModelProperty(value = "分类ID三级全部组合", required = true)
    private String categoryLevel;

    @ApiModelProperty(value = "店铺分类ID", required = true)
    @NotNull(message = "店铺分类ID不能为空")
    private BigInteger shopCategoryId;

    @ApiModelProperty(value = "店铺id", required = true)
    @NotNull(message = "店铺id不能为空")
    private BigInteger shopId;

    @ApiModelProperty(value = "店铺名称", required = true)
    @NotNull(message = "店铺名称不能为空")
    @NotBlank(message = "店铺名称不能为空")
    private String shopName;

    @ApiModelProperty(value = "商品名称")
    @NotNull(message = "商品名称不能为空")
    @NotBlank(message = "商品名称不能为空")
    private String name;

    @ApiModelProperty(value = "授权手机号")
    @NotNull(message = "授权手机不能为空")
    @NotBlank(message = "授权手机不能为空")
    private String phone;

    @ApiModelProperty(value = "卖点")
    private String sellingPoint;

    @NotNull(message = "商品图片不能为空")
    @ApiModelProperty(value = "商品介绍主图")
    private String mainImgUrl;

    @NotNull(message = "商品图片不能为空")
    @ApiModelProperty(value = "商品图片 多个图片逗号分隔")
    private String imgUrls;

    @ApiModelProperty(value = "商品视频")
    private String video;

    @ApiModelProperty(value = "售价", required = true)
    @Digits(integer = 9, fraction=2, message = "售价格式不正确,只能保留两位小数")
    @DecimalMin(value = "0.01", message = "售价必须大于0")
    @NotNull(message = "售价不能为空")
    private BigDecimal priceFee;

    @ApiModelProperty(value = "市场价，整数方式保存")
    @Digits(integer = 9, fraction=2, message = "市场价,格式不正确")
    @DecimalMin(value = "0.01", message = "市场价,格式不正确")
    //@NotNull(message = "市场价，整数方式保存不能为空")
    private BigDecimal marketPriceFee;

    @ApiModelProperty(value = "企业购售价")
    @Digits(integer = 9, fraction=2, message = "企业购售价,格式不正确")
    @DecimalMin(value = "0.01", message = "企业购售价,格式不正确")
    private BigDecimal shopPriceFee;

    @ApiModelProperty(value = "企业购市场价")
    @Digits(integer = 9, fraction=2, message = "企业购市场价,格式不正确")
    @DecimalMin(value = "0.01", message = "企业购市场价格式不正确")
    private BigDecimal shopMarketPriceFee;

    @ApiModelProperty(value = "基本单位")
    //@NotNull(message = "基本单位不能为空")
    private String unit;

    @ApiModelProperty(value = "审核状态：0：本地  5:待审核  10:审核通过  15:审核不通过")
    @NotNull(message = "审核状态不能为空")
    private Integer verifyStatus;

    @ApiModelProperty(value = "状态 -1:删除, 0:下架, 1:上架")
    private Integer status;

    @ApiModelProperty(value = "企业购  0:不是 1:是")
    private Integer hasShop;

    @ApiModelProperty(value = "sku是否含有图片 0无 1有")
    private Integer hasSkuImg;

    @ApiModelProperty(value = "序号")
    private Integer seq;

    @ApiModelProperty(value = "上架时间")
    private LocalDateTime onlineTime;

    @ApiModelProperty(value = "上架时间")
    private LocalDateTime verifyTime;
    @ApiModelProperty(value = "运费备注")
    private String freightRemark;
}
